home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Telecommunications / Updates⁄New / MicroPhone 2 Scripts / BasicMP2 / CreateStamp < prev    next >
Encoding:
Text File  |  1988-05-24  |  2.0 KB  |  50 lines  |  [TEXT/ttxt]

  1.  Settings File = TestBed
  2.  Script Name = CreateStamp
  3.  Command Key = 
  4.  F-key = 
  5.  Menu = NO
  6.  Button = NO
  7.  
  8. 1   Remark "This creates a variable named 'stamp' that"
  9. 2   Remark "contains a string composed of the date and"
  10. 3   Remark "time. It is useful for naming files created by"
  11. 4   Remark "MicroPhone II who's names need to be"
  12. 5   Remark "unique. You can concatenate it other strings"
  13. 6   Remark "you create yourself."
  14. 7   Remark "====================================="
  15. 8   Remark "Get the raw date & time"
  16. 9   Remark "====================================="
  17. 10  Set Variable dy from Expression  "=STRING(DAY)"
  18. 11  Set Variable mth from Expression  "=STRING(MONTH)"
  19. 12  Set Variable yr from Expression  "=STRING(YEAR)"
  20. 13  Set Variable hr from Expression  "=STRING(HOUR)"
  21. 14  Set Variable mn from Expression  "=STRING(MINUTE)"
  22. 15  Set Variable sec from Expression  "=STRING(SECOND)"
  23. 16  Remark "====================================="
  24. 17  Remark "Pad strings with leading zeros if needed."
  25. 18  Remark "====================================="
  26. 19  If Expression  "=LENGTH(dy) < 2"
  27. 20    Set Variable dy from Expression  "='0',dy"
  28. 21  End If
  29. 22  If Expression  "=LENGTH(mth) < 2"
  30. 23    Set Variable mth from Expression  "='0',mth"
  31. 24  End If
  32. 25  If Expression  "=LENGTH(hr) < 2"
  33. 26    Set Variable hr from Expression  "='0',hr"
  34. 27  End If
  35. 28  If Expression  "=LENGTH(mn) < 2"
  36. 29    Set Variable mn from Expression  "='0',mn"
  37. 30  End If
  38. 31  If Expression  "=LENGTH(sec) < 2"
  39. 32    Set Variable sec from Expression  "='0',sec"
  40. 33  End If
  41. 34  Remark "====================================="
  42. 35  Remark "Extract the last two digits of the year."
  43. 36  Remark "====================================="
  44. 37  Set Variable yr from Expression  "=MID(yr,3,2)"
  45. 38  Remark "====================================="
  46. 39  Remark "Now concatenate the values into one string"
  47. 40  Remark "Format of 'stamp' is: mmddyy.hhmmss"
  48. 41  Remark "====================================="
  49. 42  Set Variable stamp from Expression  "=mth,dy,yr,'.',hr,mn,sec"
  50.